import React from 'react'
import { Navigate } from 'react-router-dom'

function Hoc_login(Com) {
  return function () {
    let token = localStorage.getItem('accessToken')
    if (token) {
      return <Com></Com>
    } else {
      return <Navigate to='/login'></Navigate>
    }
  }
}

export default Hoc_login
